﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EasyCore.EndpointAudits
{
    /// <summary>
    /// 阻止重复请求
    /// </summary>
    [AttributeUsage(AttributeTargets.Module,AllowMultiple = false)]
    public class RepeatSubmitLimitAttribute:Attribute
    {
        /// <summary>
        /// 单位：秒：防止多少秒内请求重复性提交
        /// </summary>
        public int? Expire { get; set; }
        public RepeatSubmitLimitAttribute(int expire = 0) { 
            Expire = expire;        
        }
    }

    /// <summary>
    /// 重复提交类型
    /// </summary>
    public enum RepeatSubmitLimitExpireType {
        None = 0,
        AutoExpire = -1,
        FixedExpire = 10
    }
}
